home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-11-03 | 677 b | 43 lines | [TEXT/MPS ] |
- c CallAd.txt is an example of how to call a routine
- c by finding the address of any routine, passing the
- c address to a dispatch routine and calling the
- c original routine using the passed address.
-
- c Example provided for owners of Language Systems FORTRAN
- c © 1992 Language Systems Corp.
- program Callit
-
- 5 write(*,*) 'Enter a 1 or a 2:'
- !Type Command-. to quit
- Read(*,*) i
- If (i .eq. 1) then
- j = %loc(doOne)
- else
- j = %loc(doTwo)
- end if
-
- Call Dispatch(%val(j))
- go to 5
- end
-
- Subroutine Dispatch(theProc)
- External theProc
-
- Call theProc
- return
- end
-
-
- Subroutine doOne
-
- write(*,*) 'One'
- return
- end
-
- Subroutine doTwo
-
- write(*,*) 'Two'
- return
- end
-
-